<template>
    <div class="top-view-container">
        <search @search="handleSearch"></search>

        <div class="main-box">
            <div class="hero-section">
                <!-- 左侧分类 -->
                <div class="category-menu">
                    <h3 class="category-title">
                        <i class="iconfont icon-fenlei"></i>
                        商品分类
                    </h3>
                    <ul class="category-list">
                        <li v-for="(item, index) in icons" :key="index" class="category-item">
                            <div class="category-icon">
                                <i class="iconfont" v-html="item.value"></i>
                            </div>
                            <div class="category-links">
                                <router-link
                                    v-for="(category, index2) in item.categories"
                                    :key="index2"
                                    :to="{
                                        path: '/goodlist',
                                        query: { categoryId: category.id },
                                    }"
                                    class="category-link"
                                >
                                    {{ category.name }}
                                </router-link>
                            </div>
                        </li>
                    </ul>
                </div>
                <!-- 右侧：轮播图+特色服务整体 -->
                <div class="hero-main">
                    <div class="carousel-section">
                        <el-carousel
                            height="500px"
                            class="custom-carousel"
                            :interval="4000"
                            arrow="hover"
                        >
                            <el-carousel-item
                                v-for="carousel in carousels"
                                :key="carousel.id"
                                class="carousel-item"
                            >
                                <router-link :to="'/goodview/' + carousel.goodId" class="carousel-link">
                                    <img
                                        class="carousel-image"
                                        :src="baseApi + carousel.img"
                                        :alt="carousel.title || '轮播图'"
                                    />
                                    <div class="carousel-overlay">
                                        <div class="carousel-content">
                                            <h3 class="carousel-title">{{ carousel.title || '精选商品' }}</h3>
                                            <p class="carousel-desc">{{ carousel.description || '点击查看详情' }}</p>
                                        </div>
                                    </div>
                                </router-link>
                            </el-carousel-item>
                        </el-carousel>
                    </div>
                    <div class="features-section">
                        <div class="section-header">
                            <h2 class="section-title">
                                正品保障
                            </h2>
                            <p class="section-subtitle">100%正品保证，假一赔十</p>
                        </div>
                        
                        <div class="features-grid">
                            <div class="feature-item">
                                <div class="feature-icon">
                                    <img src="@/assets/img/quality/7day.jpg" alt="正品保障" />
                                </div>
                                <h4 class="feature-title">正品保障</h4>
                                <p class="feature-desc">100%正品保证，假一赔十</p>
                            </div>
                            <div class="feature-item">
                                <div class="feature-icon">
                                    <img src="@/assets/img/quality/3.jpg" alt="快速配送" />
                                </div>
                                <h4 class="feature-title">快速配送</h4>
                                <p class="feature-desc">全国包邮，24小时发货</p>
                            </div>
                            <div class="feature-item">
                                <div class="feature-icon">
                                    <img src="@/assets/img/quality/1.jpg" alt="售后无忧" />
                                </div>
                                <h4 class="feature-title">售后无忧</h4>
                                <p class="feature-desc">7天无理由退换货</p>
                            </div>
                            <div class="feature-item">
                                <div class="feature-icon">
                                    <img src="@/assets/img/quality/2.jpg" alt="安全支付">
                                </div>
                                <h4 class="feature-title">安全支付</h4>
                                <p class="feature-desc">多种支付方式，安全可靠</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 热门分类展示 -->
            <div class="hot-categories-section">
                <div class="section-header">
                    <h2 class="section-title">
                        热门分类
                    </h2>
                    <p class="section-subtitle">发现更多优质商品分类</p>
                </div>
                
                <div class="categories-grid">
                    <div 
                        v-for="(item, index) in icons.slice(0, 4)" 
                        :key="index" 
                        class="category-card"
                    >
                        <div class="category-card-content">
                            <div class="category-icon-large">
                                <i class="iconfont" v-html="item.value"></i>
                            </div>
                            <h3 class="category-name">{{ (item.categories[0] && item.categories[0].name) || '分类' }}</h3>
                            <p class="category-desc">{{ item.categories.length }}个分类</p>
                            <router-link 
                                :to="{
                                    path: '/goodlist',
                                    query: { categoryId: (item.categories[0] && item.categories[0].id) || '' }
                                }"
                                class="category-link-btn"
                            >
                                查看商品
                                <i class="iconfont icon-arrow-right"></i>
                            </router-link>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 品牌展示区域 -->
            <div class="brands-section">
                <div class="section-header">
                    <h2 class="section-title">
                        合作品牌
                    </h2>
                    <p class="section-subtitle">知名品牌，品质保证</p>
                </div>
                
                <div class="brands-3d-container">
                    <div class="brands-3d-scene" ref="brands3D">
                        <div class="brands-3d-carousel">
                            <div class="brand-item-3d" v-for="(brand, index) in brands" :key="brand.name" :style="getBrand3DStyle(index)">
                                <div class="brand-logo-3d">
                                    <img :src="brand.img" :alt="brand.name" />
                                </div>
                                <span class="brand-name-3d">{{ brand.name }}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!--推荐商品-->
            <div class="recommend-section">
                <div class="section-header">
                    <h2 class="section-title">
                        推荐商品
                    </h2>
                    <p class="section-subtitle">精选优质商品，为您推荐</p>
                </div>

                <div class="products-grid">
                    <div
                        v-for="good in good"
                        :key="good.id"
                        class="product-card-wrapper"
                    >
                        <router-link :to="'goodview/' + good.id" class="product-link">
                            <div class="product-card">
                                <div class="product-image-container">
                                    <img
                                        :src="baseApi + good.imgs"
                                        class="product-image"
                                        :alt="good.name"
                                    />
                                    <div class="product-overlay">
                                        <i class="iconfont icon-chakan"></i>
                                    </div>
                                </div>
                                <div class="product-info">
                                    <h3 class="product-name">{{ good.name }}</h3>
                                    <div class="product-price">
                                        <span class="price-symbol">￥</span>
                                        <span class="price-value">{{ good.price }}</span>
                                    </div>
                                </div>
                            </div>
                        </router-link>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import search from "../../components/Search";

export default {
    name: "TopView",
    data() {
        return {
            //轮播图
            carousels: [],
            //推荐商品
            good: [],
            baseApi: this.$store.state.baseApi,

            //分类icon，每个icon包含id、value、categories对象数组.category：id，name
            icons: [],
            //搜索内容
            searchText: "",
            // 品牌数据
            brands: [
                { name: '京东', img: require('@/assets/img/brand/jd.jpg') },
                { name: '天猫', img: require('@/assets/img/brand/tianmao.jpg') },
                { name: '拼多多', img: require('@/assets/img/brand/pdd.jpg') },
                { name: '得物', img: require('@/assets/img/brand/dewu.jpg') },
                { name: '1688', img: require('@/assets/img/brand/1688.png') },
                { name: '美团', img: require('@/assets/img/brand/meituan.png') },
                { name: '圆通', img: require('@/assets/img/brand/yuantong.jpg') },
                { name: '中通', img: require('@/assets/img/brand/zhongtong.jpg') },
            ],
        };
    },
    components: {
        search,
    },
    created() {
        this.request
            .get("/api/good")
            .then((res) => {
                if (res.code === "200") {
                    this.good = res.data;
                } else {
                    this.$message.error(res.msg);
                }
            })
            .catch((e) => {
                console.log(e);
                if (e.response == undefined || e.response.data == undefined) {
                    this.$message({
                        showClose: true,
                        message: e,
                        type: "error",
                        duration: 5000,
                    });
                } else {
                    this.$message({
                        showClose: true,
                        message: e.response.data,
                        type: "error",
                        duration: 5000,
                    });
                }
            });
        this.request
            .get("/api/icon")
            .then((res) => {
                if (res.code === "200") {
                    this.icons = res.data;
                    if (this.icons.length > 6) {
                        // 截取前六个分类
                        this.icons = this.icons.slice(0, 6);
                    }
                }
            })
            .catch((e) => {
                console.log(e);
                if (e.response == undefined || e.response.data == undefined) {
                    this.$message({
                        showClose: true,
                        message: e,
                        type: "error",
                        duration: 5000,
                    });
                } else {
                    this.$message({
                        showClose: true,
                        message: e.response.data,
                        type: "error",
                        duration: 5000,
                    });
                }
            });
        this.request
            .get("/api/carousel")
            .then((res) => {
                if (res.code === "200") {
                    this.carousels = res.data;
                }
                
            })
            .catch((e) => {
                console.log(e);
                if (e.response == undefined || e.response.data == undefined) {
                    this.$message({
                        showClose: true,
                        message: e,
                        type: "error",
                        duration: 5000,
                    });
                } else {
                    this.$message({
                        showClose: true,
                        message: e.response.data,
                        type: "error",
                        duration: 5000,
                    });
                }
                
            });
    },
    methods: {
        handleSearch(text) {
            this.searchText = text;
            this.$router.push({
                path: "/goodList",
                query: { searchText: this.searchText },
            });
        },
        handleCarouselChange(index) {
            this.currentCarouselIndex = index;
        },
        // 计算3D品牌位置 - 优化版本
        getBrand3DStyle(index) {
            const total = this.brands.length;
            const angle = (360 / total) * index;
            const radius = 180; // 3D圆形半径
            
            return {
                transform: `rotateY(${angle}deg) translateZ(${radius}px)`,
                animationDelay: `${index * 0.1}s`
            };
        },
        // 修改后的init3DBrands方法
        init3DBrands() {
            this.$nextTick(() => {
                const scene = this.$refs.brands3D;
                if (scene) {
                    const carousel = scene.querySelector('.brands-3d-carousel');
                    const brandItems = scene.querySelectorAll('.brand-item-3d');
                    
                    if (carousel && brandItems.length > 0) {
                        // 为每个品牌卡片添加鼠标事件
                        brandItems.forEach(item => {
                            item.addEventListener('mouseenter', () => {
                                carousel.style.animationPlayState = 'paused';
                            });
                            item.addEventListener('mouseleave', () => {
                                carousel.style.animationPlayState = 'running';
                            });
                        });
                    }
                }
            });
        }
    },
    mounted() {
        this.init3DBrands();
    },
};
</script>

<style scoped>
.top-view-container {
  min-height: 100vh;

}

.main-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 30px;
  margin: 20px auto;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px;
}

/* 英雄区域 */
.hero-section {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
}

/* 分类菜单 */
.category-menu {
  flex: 0 0 280px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
  position: relative;
  overflow: hidden;
}

.category-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.category-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.category-title i {
  font-size: 22px;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 1;
}

.category-item {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

.category-icon {
  text-align: center;
  margin-bottom: 10px;
}

.category-icon i {
  font-size: 24px;
  color: #ffffff;
}

.category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.category-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 15px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
}

.category-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}
.hero-main{
  width: 100%;
}
/* 轮播图区域 */
.carousel-section {
  flex: 1;
  width: 100%;
}

.custom-carousel {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  height: 500px;
}

/* 修复 Element UI 轮播图容器移动问题 */
.custom-carousel .el-carousel__container {
  position: relative !important;
  transform: none !important;
  transition: none !important;
  height: 500px !important;
}

.custom-carousel .el-carousel__item {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: translateX(0) !important;
  transition: opacity 0.5s ease !important;
  opacity: 0;
}

.custom-carousel .el-carousel__item.is-active {
  opacity: 1 !important;
  z-index: 2;
}

.carousel-item {
  position: relative;
}

.carousel-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.carousel-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.carousel-section:hover .carousel-image {
  transform: scale(1.05);
}

.carousel-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 30px;
  z-index: 10;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.carousel-section:hover .carousel-overlay {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
}

.carousel-content {
  color: #ffffff;
}

.carousel-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.carousel-desc {
  font-size: 16px;
  margin: 0;
  opacity: 0.9;
}

/* 推荐商品区域 */
.recommend-section {
  margin-top: 40px;
}

.section-header {
  text-align: center;
  margin-bottom: 30px;
}

.section-title {
  font-size: 32px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.section-title i {
  color: #667eea;
  font-size: 28px;
}

.section-subtitle {
  font-size: 16px;
  color: #666;
  margin: 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.product-card-wrapper {
  transition: all 0.3s ease;
}

.product-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card {
  background: #ffffff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.product-image-container {
  position: relative;
  overflow: hidden;
  height: 250px;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-overlay i {
  color: #ffffff;
  font-size: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 15px;
  backdrop-filter: blur(10px);
}

.product-info {
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 10px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.price-symbol {
  color: #e74c3c;
  font-size: 16px;
  font-weight: 600;
}

.price-value {
  color: #e74c3c;
  font-size: 22px;
  font-weight: 700;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .hero-section {
    flex-direction: column;
    gap: 20px;
  }
  
  .category-menu {
    flex: none;
  }
  
  .category-links {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .main-box {
    margin: 10px;
    padding: 20px;
  }
  
  .section-title {
    font-size: 24px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }
  
  .category-menu {
    padding: 20px;
  }
  
  .carousel-image {
    height: 250px;
  }
}

/* 特色服务区域 */
.features-section {
  margin: 40px 0;
  padding: 40px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 20px;
}

.features-grid {
    height: 270px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 30px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.feature-item {
  text-align: center;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  img{
    width: 100%;
    height: 100%;
  }
}

.feature-icon i {
  font-size: 32px;
  color: #ffffff;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 10px 0;
}

.feature-desc {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* 热门分类展示 */
.hot-categories-section {
  margin: 40px 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.category-card {
  background: #ffffff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.category-card-content {
  padding: 30px;
  text-align: center;
}

.category-icon-large {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.category-icon-large i {
  font-size: 32px;
  color: #ffffff;
}

.category-name {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 10px 0;
}

.category-desc {
  font-size: 14px;
  color: #666;
  margin: 0 0 20px 0;
}

.category-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.category-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  color: white;
  text-decoration: none;
}

.category-link-btn i {
  font-size: 14px;
}


.brands-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.brands-3d-container {
  width: 100%;
  height: 450px;
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background-color: #f0f0f0;
  border-radius: 20px;
}

.brands-3d-scene {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.brands-3d-carousel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  animation: rotate3D 25s linear infinite;
  will-change: transform;
}

@keyframes rotate3D {
  0% {
    transform: translate(-50%, -50%) rotateY(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotateY(360deg);
  }
}

.brand-item-3d {
  position: absolute;
  width: 100px;
  height: 120px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  transition: all 0.4s ease;
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  left: 50%;
  top: 50%;
  margin-left: -50px;
  margin-top: -60px;
  transform-origin: center center;
  cursor: pointer;
  overflow: hidden;
}

.brand-item-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.brand-item-3d:hover::before {
  opacity: 1;
}

.brand-item-3d:hover {
  transform: scale(1.15) translateZ(20px);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 1);
}

.brand-logo-3d {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
}

.brand-logo-3d::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.brand-logo-3d:hover::after {
  opacity: 1;
}

.brand-logo-3d img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.brand-item-3d:hover .brand-logo-3d {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.brand-item-3d:hover .brand-logo-3d img {
  transform: scale(1.05);
}

.brand-name-3d {
  font-size: 12px;
  font-weight: 700;
  color: #333;
  transition: all 0.4s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.brand-item-3d:hover .brand-name-3d {
  color: #667eea;
  transform: translateY(-2px);
  text-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}


@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

</style>